#include<func.h>
int main(int argc,char* argv[])
{
    ARGS_CHECK(argc,2)
    DIR* dir;
    dir=opendir(argv[1]);
    ERROR_CHECK(dir,NULL,"opendir")
    struct dirent *pdir;
    off_t pos;
    while(pdir=readdir(dir))
    {
        printf("ino=%ld len=%d type=%d filename=%s\n",pdir->d_ino,pdir->d_reclen,pdir->d_type,pdir->d_name);
        if(strcmp(pdir->d_name,"seek.c")==0)
        {
            pos=telldir(dir);
        }
    }
    //seekdir(dir,pos);
    rewinddir(dir);
    pdir=readdir(dir);
     printf("rewindino=%ld len=%d type=%d filename=%s\n",pdir->d_ino,pdir->d_reclen,pdir->d_type,pdir->d_name);
    closedir(dir);
    return 0;
}